import pytest
from appium.webdriver.common.appiumby import AppiumBy
from loguru import logger

from basic.basedriver import DRIVER
from page.page_main import PageMain

NINE = PageMain()
@pytest.fixture(scope="function",autouse=True)
def init_case():
    DRIVER.activate_app("com.xiaomi.shop")
    yield
    DRIVER.terminate_app("com.xiaomi.shop")
# @pytest.fixture(scope="function",autouse=True)
# def back_home():
#     logger.debug(f"{'=' * 20 }开始执行用例{'=' * 20}")
#     yield
#     while DRIVER.current_activity !='com.xiaomi.shop2.activity.MainActivity':
#         DRIVER.back()
#     logger.debug(f"{'=' * 20 }返回到首页{'=' * 20}")